<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> 
<style>
#relate .nav-tabs{min-height:620px;}
#relate{background-color:#fff;}
#relate .tab-pane{border-right:1px solid #D4D4D4;}
</style>
<div id="relate" class="tabbable tabs-left">
  <ul class="nav nav-tabs">
  <c:forEach var="field" items="${fields }" varStatus="status">
     <li class='<c:if test="${status.index==0}">active</c:if>'><a href="#${field.mc_attr_name}" data-toggle="tab"><i class="icon-double-angle-right"></i> ${field.mc_prompt}</a></li>
  </c:forEach>   
   </ul>
  <div class="tab-content">
  	<c:forEach var="field" items="${fields }" varStatus="status">
  	<div class='tab-pane <c:if test="${status.index==0}">active</c:if>' id="${field.mc_attr_name}">
     	<fieldset>
     	<legend></legend>
     	<form method="post" class="form-horizontal" action="<%=request.getContextPath()%>/c?s=model&o=modifyrelation&isajax=1&mc_model_id=${model.m_id}">
     		<div class="control-group">
     			<label class="control-label">字段:</label>
     			<div class="controls">
     				<input type="text" readonly="readonly" name="mc_attr_name" value="${field.mc_attr_name}" />
     			</div>
     		</div>
     		<div class="control-group">
     			<label class="control-label">显示:</label>
     			<div class="controls">
     				<input class="yncheckbox" type="checkbox"  <c:if test="${field.mc_show eq 1}">checked='checked'</c:if>/>
					<input type="hidden"  name="mc_show" class="ynradio" value="${field.mc_show }" />
     			</div>
     		</div>
     		<div class="control-group">
     			<label class="control-label">编辑:</label>
     			<div class="controls">
     				<input class="yncheckbox" type="checkbox"  <c:if test="${field.mc_edit eq 1}">checked='checked'</c:if>/>
					<input type="hidden"  name="mc_edit" class="ynradio" value="${field.mc_edit }" />
     			</div>
     		</div>
     		<div class="control-group">
     			<label class="control-label">默认值:</label>
     			<div class="controls">
     				<input type="text" name="mc_dft_val" value="${field.mc_dft_val}" />
     			</div>
     		</div>
     		<div class="control-group">
     			<label class="control-label">提示:</label>
     			<div class="controls">
     				<input type="text" name="mc_prompt" value="${field.mc_prompt}" />
     			</div>
     		</div>
     		<div class="control-group">
     			<label class="control-label">控件索引:</label>
     			<div class="controls">
					<input type="text" name="mc_index" value='<c:choose><c:when test="${field.mc_index ne null}">${field.mc_index}</c:when><c:otherwise>0</c:otherwise></c:choose>' />
     			</div>
     		</div>
     		<div class="control-group">
     			<label class="control-label">选择控件:</label>
     			<div class="controls">
					<select name="mc_control_id">
					<c:forEach var="option" items="${options }">
					<option value="${option.c_id }" <c:if test="${option.c_id==field.mc_control_id}">selected="selected"</c:if>>${option.c_title }</option>
					</c:forEach>
					</select>
     			</div>
     		</div>
     		<div class="control-group">
     			<label class="control-label">选择数据源:</label>
     			<div class="controls">
     				<select name="mc_ds">
     				<option value="0">选择</option>
     				<c:forEach var="d" items="${ds }">
					<option value="${d.ds_id }" <c:if test="${d.ds_id==field.mc_ds}">selected="selected"</c:if>>${d.ds_name }</option>
					</c:forEach>
					</select>
     			</div>
     		</div>
     		<div class="form-actions">
				<button class="btn btn-primary btn-ajax-save"><i class="icon-save"></i> <span>保存</span></button>
				<button class="btn btn-back">返回</button>
			</div>
     	</form>
     	</fieldset>
   	</div>
   	</c:forEach>
  </div>
</div>